import React, { Component } from 'react';
import {
  BrowserRouter as Router,
  Route,
  Link
} from 'react-router-dom'
import routes from '../router/Router'
class App extends Component {
  render() {
    return (
      <Router>
        <div className="App">
          <ul style={{ listStyleType: 'none', padding: 0 }}>
            <li><Link to="/">Home</Link></li>
            <li><Link to="/about">About</Link></li>
            <li><Link to="/cate">Category</Link></li>
          </ul>
          {routes.map((route,i)=>{
            return <Route
                key={i}
                path={route.path}
                exact={route.exact}
                component={route.component}/>
          })}
        </div>
      </Router>
    );
  }
}

export default App;
